# -*- coding:utf-8 -*-
from common.my_http import MyHttp
from common.my_baidu import MyBaidu
from common.my_time import MyTime
from common.my_file import MyFile
from base_market import MarketBase
import glob
import jieba
import re
import threading
import hashlib
import urllib.parse
import time
import os


'''
造纸行业
'''


class BaiduZaozhi(MarketBase):
    def __init__(self, file_name):
        MarketBase.__init__(self, file_name)
        pass

    def __del__(self):
        pass
        
    
    def set_param(self):
        self.set_check_title(False)
        self.set_type(2306)
        self.set_max_page(8) 
        self.set_forward(30)
    
    def do_query(self, word):
        self.set_param()
        print("do_query")
        entitys = ["白纸","纸袋","木浆","竹浆","书写纸","白卡纸","轻涂纸","铜版纸","防粘原纸","生活纸","生活用纸","双胶纸","新闻纸","机制纸","静电纸","石膏护面纸","纸板","箱板纸","瓦楞纸","卡纸","文化纸","面纸","机械浆","化学浆","牛皮箱板纸","特种纸","再生纤维"]
        for d in entitys:
            self.get_data([d, word], [[d],[word]], ["?",";","-"])


def zaozhi_api():
    d = BaiduZaozhi('./out/' + os.path.split(__file__)[-1].split(".")[0] + ".log")
    d.do_query("行业")
    d.do_query("产量")
    d.do_query("价格")
    d.do_query("政策")
    d.do_query("进口")
    d.do_query("出口")
    d.do_query("反倾销")

if __name__ == '__main__':
    zaozhi_api()
